package chap1.duck1;

import chap1.duck1.children.DecoyDuck;
import chap1.duck1.children.MallardDuck;
import chap1.duck1.children.RedheadDuck;
import chap1.duck1.children.RubberDuck;

public class SimuDuck {

    public static void main(String[] args) {
        new SimuDuck().test();
    }
    
    public void test() {
        testDuck(new MallardDuck());
        testDuck(new RedheadDuck());
        testDuck(new RubberDuck());
        testDuck(new DecoyDuck());
    }

    public void testDuck(Duck duck) {
        duck.display();
        duck.quack();
        duck.swim();
        duck.fly();
    }
}
